<?xml version="1.0" encoding="iso-8859-1"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
  <html xmlns="http://www.w3.org/1999/xhtml">
<head>
	<title>File Source for index.php</title>
	<link rel="stylesheet" type="text/css" href="../media/style.css">
	<meta http-equiv='Content-Type' content='text/html; charset=iso-8859-1'/>
</head>
<body>

<table border="0" cellspacing="0" cellpadding="0" height="48" width="100%">
  <tr>
	<td class="header-top-left"><img src="../media/logo.png" border="0" alt="phpDocumentor " /></td>
    <td class="header-top-right">Google-XML-Sitemap-Feed<br /><div class="header-top-right-subpackage"></div></td>
  </tr>
  <tr><td colspan="2" class="header-line"><img src="../media/empty.png" width="1" height="1" border="0" alt=""  /></td></tr>
  <tr>
    <td colspan="2" class="header-menu">
  		  [ <a href="../classtrees_Google-XML-Sitemap-Feed.html" class="menu">class tree: Google-XML-Sitemap-Feed</a> ]
		  [ <a href="../elementindex_Google-XML-Sitemap-Feed.html" class="menu">index: Google-XML-Sitemap-Feed</a> ]
		  [ <a href="../elementindex.html" class="menu">all elements</a> ]
    </td>
  </tr>
  <tr><td colspan="2" class="header-line"><img src="../media/empty.png" width="1" height="1" border="0" alt=""  /></td></tr>
</table>

<table width="100%" border="0" cellpadding="0" cellspacing="0">
  <tr valign="top">
    <td width="195" class="menu">
		<div class="package-title">Google-XML-Sitemap-Feed</div>
      <b>Packages:</b><br />
  <div class="package">
              <a href="../li_Google-XML-Sitemap-Feed.html">Google-XML-Sitemap-Feed</a><br />
      	</div>
      <br />
                        <br />
                </td>
    <td>
      <table cellpadding="10" cellspacing="0" width="100%" border="0"><tr><td valign="top">

<h1 align="center">Source for file index.php</h1>
<p>Documentation is available at <a href="../Google-XML-Sitemap-Feed/_googlesitemap_index_php.html">index.php</a></p>
<div class="src-code"><span class="php">
<div class="listing"><pre><ol><li><a name="a1"></a><span class="src-php">&lt;?php</span></li>
<li><a name="a2"></a><span class="src-doc">/**</span></li>
<li><a name="a3"></a><span class="src-doc"> * Google XML Sitemap Feed Cron Script</span></li>
<li><a name="a4"></a><span class="src-doc"> *</span></li>
<li><a name="a5"></a><span class="src-doc"> * The Google sitemap service was announced on 2 June 2005 and represents</span></li>
<li><a name="a6"></a><span class="src-doc"> * a huge development in terms of crawler technology.  This contribution is</span></li>
<li><a name="a7"></a><span class="src-doc"> * designed to create the sitemap XML feed per the specification delineated</span></li>
<li><a name="a8"></a><span class="src-doc"> * by Google.  This cron script will call the code to create the scripts and</span></li>
<li><a name="a9"></a><span class="src-doc"> * eliminate the session auto start issues.</span></li>
<li><a name="a10"></a><span class="src-doc"> * </span><span class="src-doc-coretag">@package</span><span class="src-doc"> Google-XML-Sitemap-Feed</span></li>
<li><a name="a11"></a><span class="src-doc"> * </span><span class="src-doc-coretag">@license</span><span class="src-doc"> http://opensource.org/licenses/gpl-license.php GNU Public License</span></li>
<li><a name="a12"></a><span class="src-doc"> * </span><span class="src-doc-coretag">@version</span><span class="src-doc"> 1.0</span></li>
<li><a name="a13"></a><span class="src-doc"> * </span><span class="src-doc-coretag">@link</span><span class="src-doc"> http://www.oscommerce-freelancers.com/ osCommerce-Freelancers</span></li>
<li><a name="a14"></a><span class="src-doc"> * </span><span class="src-doc-coretag">@link</span><span class="src-doc"> http://www.google.com/webmasters/sitemaps/docs/en/about.html About Google Sitemap</span></li>
<li><a name="a15"></a><span class="src-doc"> * </span><span class="src-doc-coretag">@copyright</span><span class="src-doc"> Copyright 2005, Bobby Easland</span></li>
<li><a name="a16"></a><span class="src-doc"> * </span><span class="src-doc-coretag">@author</span><span class="src-doc"> Bobby Easland</span></li>
<li><a name="a17"></a><span class="src-doc"> * </span><span class="src-doc-coretag">@filesource</span></li>
<li><a name="a18"></a><span class="src-doc"> */</span></li>
<li><a name="a19"></a>&nbsp;</li>
<li><a name="a20"></a><a href="http://www.php.net/chdir">chdir</a><span class="src-sym">(</span><span class="src-str">'../'</span><span class="src-sym">)</span><span class="src-sym">;</span></li>
<li><a name="a21"></a><span class="src-doc">/**</span></li>
<li><a name="a22"></a><span class="src-doc"> * Option to compress the files</span></li>
<li><a name="a23"></a><span class="src-doc"> */</span></li>
<li><a name="a24"></a><a href="http://www.php.net/define">define</a><span class="src-sym">(</span><span class="src-str">'GOOGLE_SITEMAP_COMPRESS'</span><span class="src-sym">, </span><span class="src-str">'false'</span><span class="src-sym">)</span><span class="src-sym">;</span></li>
<li><a name="a25"></a><span class="src-doc">/**</span></li>
<li><a name="a26"></a><span class="src-doc"> * Option for change frequency of products</span></li>
<li><a name="a27"></a><span class="src-doc"> */</span></li>
<li><a name="a28"></a><a href="http://www.php.net/define">define</a><span class="src-sym">(</span><span class="src-str">'GOOGLE_SITEMAP_PROD_CHANGE_FREQ'</span><span class="src-sym">, </span><span class="src-str">'weekly'</span><span class="src-sym">)</span><span class="src-sym">;</span></li>
<li><a name="a29"></a><span class="src-doc">/**</span></li>
<li><a name="a30"></a><span class="src-doc"> * Option for change frequency of categories</span></li>
<li><a name="a31"></a><span class="src-doc"> */</span></li>
<li><a name="a32"></a><a href="http://www.php.net/define">define</a><span class="src-sym">(</span><span class="src-str">'GOOGLE_SITEMAP_CAT_CHANGE_FREQ'</span><span class="src-sym">, </span><span class="src-str">'weekly'</span><span class="src-sym">)</span><span class="src-sym">;</span></li>
<li><a name="a33"></a><span class="src-doc">/**</span></li>
<li><a name="a34"></a><span class="src-doc"> * Carried over from application_top.php for compatibility</span></li>
<li><a name="a35"></a><span class="src-doc"> */</span></li>
<li><a name="a36"></a><a href="http://www.php.net/define">define</a><span class="src-sym">(</span><span class="src-str">'DIR_WS_CATALOG'</span><span class="src-sym">, </span><span class="src-id">DIR_WS_HTTP_CATALOG</span><span class="src-sym">)</span><span class="src-sym">;</span></li>
<li><a name="a37"></a>&nbsp;</li>
<li><a name="a38"></a><span class="src-inc">require_once</span><span class="src-sym">(</span><span class="src-str">'includes/configure.php'</span><span class="src-sym">)</span><span class="src-sym">;</span></li>
<li><a name="a39"></a><span class="src-inc">require_once</span><span class="src-sym">(</span><span class="src-id">DIR_WS_INCLUDES </span>. <span class="src-str">'filenames.php'</span><span class="src-sym">)</span><span class="src-sym">;</span></li>
<li><a name="a40"></a><span class="src-inc">require_once</span><span class="src-sym">(</span><span class="src-id">DIR_WS_INCLUDES </span>. <span class="src-str">'database_tables.php'</span><span class="src-sym">)</span><span class="src-sym">;</span></li>
<li><a name="a41"></a><span class="src-inc">require_once</span><span class="src-sym">(</span><span class="src-id">DIR_WS_FUNCTIONS </span>. <span class="src-str">'database.php'</span><span class="src-sym">)</span><span class="src-sym">;</span></li>
<li><a name="a42"></a><span class="src-id">tep_db_connect</span><span class="src-sym">(</span><span class="src-sym">) </span><span class="src-key">or </span><span class="src-key">die</span><span class="src-sym">(</span><span class="src-str">'Unable to connect to database server!'</span><span class="src-sym">)</span><span class="src-sym">;</span></li>
<li><a name="a43"></a><span class="src-var">$configuration_query </span>= <span class="src-id">tep_db_query</span><span class="src-sym">(</span><span class="src-str">'select configuration_key as cfgKey, configuration_value as cfgValue from ' </span>. <span class="src-id">TABLE_CONFIGURATION</span><span class="src-sym">)</span><span class="src-sym">;</span></li>
<li><a name="a44"></a><span class="src-key">while </span><span class="src-sym">(</span><span class="src-var">$configuration </span>= <span class="src-id">tep_db_fetch_array</span><span class="src-sym">(</span><span class="src-var">$configuration_query</span><span class="src-sym">)) </span><span class="src-sym">{</span></li>
<li><a name="a45"></a>    <a href="http://www.php.net/define">define</a><span class="src-sym">(</span><span class="src-var">$configuration</span><span class="src-sym">[</span><span class="src-str">'cfgKey'</span><span class="src-sym">]</span><span class="src-sym">, </span><span class="src-var">$configuration</span><span class="src-sym">[</span><span class="src-str">'cfgValue'</span><span class="src-sym">]</span><span class="src-sym">)</span><span class="src-sym">;</span></li>
<li><a name="a46"></a><span class="src-sym">}</span></li>
<li><a name="a47"></a><span class="src-inc">require_once</span><span class="src-sym">(</span><span class="src-id">DIR_WS_FUNCTIONS </span>. <span class="src-str">'general.php'</span><span class="src-sym">)</span><span class="src-sym">;</span></li>
<li><a name="a48"></a><span class="src-inc">require_once</span><span class="src-sym">(</span><span class="src-id">DIR_WS_FUNCTIONS </span>. <span class="src-str">'html_output.php'</span><span class="src-sym">)</span><span class="src-sym">;</span></li>
<li><a name="a49"></a><span class="src-inc">include_once</span><span class="src-sym">(</span><span class="src-id">DIR_WS_CLASSES </span>. <span class="src-str">'language.php'</span><span class="src-sym">)</span><span class="src-sym">;</span></li>
<li><a name="a50"></a><span class="src-var">$lng </span>= <span class="src-key">new </span><span class="src-id">language</span><span class="src-sym">(</span><span class="src-sym">)</span><span class="src-sym">;</span></li>
<li><a name="a51"></a><span class="src-var">$lng</span><span class="src-sym">-&gt;</span><span class="src-id">get_browser_language</span><span class="src-sym">(</span><span class="src-sym">)</span><span class="src-sym">;</span></li>
<li><a name="a52"></a><span class="src-var">$languages_id </span>= <span class="src-var">$lng</span><span class="src-sym">-&gt;</span><span class="src-id">language</span><span class="src-sym">[</span><span class="src-str">'id'</span><span class="src-sym">]</span><span class="src-sym">;</span></li>
<li><a name="a53"></a>&nbsp;</li>
<li><a name="a54"></a><span class="src-key">if </span><span class="src-sym">( </span><a href="http://www.php.net/file_exists">file_exists</a><span class="src-sym">(</span><span class="src-id">DIR_WS_CLASSES </span>. <span class="src-str">'seo.class.php'</span><span class="src-sym">) )</span><span class="src-sym">{</span></li>
<li><a name="a55"></a>    <span class="src-inc">require_once</span><span class="src-sym">(</span><span class="src-id">DIR_WS_CLASSES </span>. <span class="src-str">'seo.class.php'</span><span class="src-sym">)</span><span class="src-sym">;</span></li>
<li><a name="a56"></a>    <span class="src-var">$seo_urls </span>= <span class="src-key">new </span><span class="src-id">SEO_URL</span><span class="src-sym">(</span><span class="src-var">$languages_id</span><span class="src-sym">)</span><span class="src-sym">;</span></li>
<li><a name="a57"></a><span class="src-sym">}</span></li>
<li><a name="a58"></a>&nbsp;</li>
<li><a name="a59"></a><span class="src-key">if </span><span class="src-sym">( </span><a href="http://www.php.net/file_exists">file_exists</a><span class="src-sym">(</span><span class="src-id">DIR_WS_CLASSES </span>. <span class="src-str">'cache.class.php'</span><span class="src-sym">) )</span><span class="src-sym">{</span></li>
<li><a name="a60"></a>    <span class="src-inc">include</span><span class="src-sym">(</span><span class="src-id">DIR_WS_CLASSES </span>. <span class="src-str">'cache.class.php'</span><span class="src-sym">)</span><span class="src-sym">;</span></li>
<li><a name="a61"></a>    <span class="src-var">$cache </span>= <span class="src-key">new </span><span class="src-id">cache</span><span class="src-sym">(</span><span class="src-var">$languages_id</span><span class="src-sym">)</span><span class="src-sym">;</span></li>
<li><a name="a62"></a><span class="src-sym">}</span></li>
<li><a name="a63"></a>&nbsp;</li>
<li><a name="a64"></a><span class="src-key">if </span><span class="src-sym">( </span><a href="http://www.php.net/file_exists">file_exists</a><span class="src-sym">(</span><span class="src-str">'includes/seo_cache.php'</span><span class="src-sym">) )</span><span class="src-sym">{</span></li>
<li><a name="a65"></a>    <span class="src-inc">include</span><span class="src-sym">(</span><span class="src-str">'includes/seo_cache.php'</span><span class="src-sym">)</span><span class="src-sym">;</span></li>
<li><a name="a66"></a>    <span class="src-var">$cache</span><span class="src-sym">-&gt;</span><span class="src-id">get_cache</span><span class="src-sym">(</span><span class="src-str">'GLOBAL'</span><span class="src-sym">)</span><span class="src-sym">;</span></li>
<li><a name="a67"></a><span class="src-sym">}</span></li>
<li><a name="a68"></a>&nbsp;</li>
<li><a name="a69"></a><span class="src-inc">require_once</span><span class="src-sym">(</span><span class="src-str">'googlesitemap/sitemap.class.php'</span><span class="src-sym">)</span><span class="src-sym">;</span></li>
<li><a name="a70"></a>&nbsp;</li>
<li><a name="a71"></a><span class="src-var">$google </span>= <span class="src-key">new </span><span class="src-id"><a href="../Google-XML-Sitemap-Feed/GoogleSitemap.html">GoogleSitemap</a></span><span class="src-sym">(</span><span class="src-id">DB_SERVER</span><span class="src-sym">, </span><span class="src-id">DB_SERVER_USERNAME</span><span class="src-sym">, </span><span class="src-id">DB_DATABASE</span><span class="src-sym">, </span><span class="src-id">DB_SERVER_PASSWORD</span><span class="src-sym">)</span><span class="src-sym">;</span></li>
<li><a name="a72"></a>&nbsp;</li>
<li><a name="a73"></a><span class="src-var">$submit </span>= <span class="src-id">true</span><span class="src-sym">;</span></li>
<li><a name="a74"></a><span class="src-key">if </span><span class="src-sym">(</span><span class="src-var">$google</span><span class="src-sym">-&gt;</span><span class="src-id">GenerateProductSitemap</span><span class="src-sym">(</span><span class="src-sym">))</span><span class="src-sym">{</span></li>
<li><a name="a75"></a>    echo <span class="src-str">'Generated Google Product Sitemap Successfully' </span>. <span class="src-str">&quot;\n\n&quot;</span><span class="src-sym">;</span></li>
<li><a name="a76"></a><span class="src-sym">} </span><span class="src-key">else </span><span class="src-sym">{</span></li>
<li><a name="a77"></a>    <span class="src-var">$submit </span>= <span class="src-id">false</span><span class="src-sym">;</span></li>
<li><a name="a78"></a>    echo <span class="src-str">'ERROR: Google Product Sitemap Generation FAILED!' </span>. <span class="src-str">&quot;\n\n&quot;</span><span class="src-sym">;</span></li>
<li><a name="a79"></a><span class="src-sym">}</span></li>
<li><a name="a80"></a>&nbsp;</li>
<li><a name="a81"></a><span class="src-key">if </span><span class="src-sym">(</span><span class="src-var">$google</span><span class="src-sym">-&gt;</span><span class="src-id">GenerateCategorySitemap</span><span class="src-sym">(</span><span class="src-sym">))</span><span class="src-sym">{</span></li>
<li><a name="a82"></a>    echo <span class="src-str">'Generated Google Category Sitemap Successfully' </span>. <span class="src-str">&quot;\n\n&quot;</span><span class="src-sym">;</span></li>
<li><a name="a83"></a><span class="src-sym">} </span><span class="src-key">else </span><span class="src-sym">{</span></li>
<li><a name="a84"></a>    <span class="src-var">$submit </span>= <span class="src-id">false</span><span class="src-sym">;</span></li>
<li><a name="a85"></a>    echo <span class="src-str">'ERROR: Google Category Sitemap Generation FAILED!' </span>. <span class="src-str">&quot;\n\n&quot;</span><span class="src-sym">;</span></li>
<li><a name="a86"></a><span class="src-sym">}</span></li>
<li><a name="a87"></a>&nbsp;</li>
<li><a name="a88"></a><span class="src-key">if </span><span class="src-sym">(</span><span class="src-var">$google</span><span class="src-sym">-&gt;</span><span class="src-id">GenerateSitemapIndex</span><span class="src-sym">(</span><span class="src-sym">))</span><span class="src-sym">{</span></li>
<li><a name="a89"></a>    echo <span class="src-str">'Generated Google Sitemap Index Successfully' </span>. <span class="src-str">&quot;\n\n&quot;</span><span class="src-sym">;</span></li>
<li><a name="a90"></a><span class="src-sym">} </span><span class="src-key">else </span><span class="src-sym">{</span></li>
<li><a name="a91"></a>    <span class="src-var">$submit </span>= <span class="src-id">false</span><span class="src-sym">;</span></li>
<li><a name="a92"></a>    echo <span class="src-str">'ERROR: Google Sitemap Index Generation FAILED!' </span>. <span class="src-str">&quot;\n\n&quot;</span><span class="src-sym">;</span></li>
<li><a name="a93"></a><span class="src-sym">}</span></li>
<li><a name="a94"></a>&nbsp;</li>
<li><a name="a95"></a><span class="src-key">if </span><span class="src-sym">(</span><span class="src-var">$submit</span><span class="src-sym">)</span><span class="src-sym">{</span></li>
<li><a name="a96"></a>    echo <span class="src-str">'All files generated successfully.  If you have not already submitted the sitemap index to Google click the link below.' </span>. <span class="src-str">&quot;\n\n&quot;</span><span class="src-sym">;</span></li>
<li><a name="a97"></a>    echo <span class="src-var">$google</span><span class="src-sym">-&gt;</span><span class="src-id">GenerateSubmitURL</span><span class="src-sym">(</span><span class="src-sym">)</span><span class="src-sym">;</span></li>
<li><a name="a98"></a><span class="src-sym">}</span></li>
<li><a name="a99"></a><span class="src-php">?&gt;</span></li>
</ol></pre></div>
</span></div>
        <div class="credit">
		    <hr class="separator" />
		    Documentation generated on Sat,  4 Jun 2005 23:45:56 -0400 by <a href="http://www.phpdoc.org">phpDocumentor 1.3.0RC3</a>
	      </div>
      </td></tr></table>
    </td>
  </tr>
</table>

</body>
</html>